.group
  =f.label :title
  =f.text_field :title, :class => :text_field

.group
  =f.label :slug
  =f.text_field :slug, :class => :text_field

.group
  =f.label :infrastructure
  =f.check_box :infrastructure, :class => :check_box

.group
  =f.label :description
  =f.text_area :description, :class => :text_area

.group
  =f.label :owner_id
  =f.collection_select :owner_id, Person.all, :id, :display_name, {}, {:class => :collection}

.group
  =f.label :documents
  -@system.documents.each_with_index do |document, index|
    =f.fields_for "document[#{index}]", document do |b|
      =render "admin/documents/indexed_subitem", { :f => b, :document => document }

.group.navform.wat-cf
  =f.submit pat(:save), :class => :button
  =f.submit pat(:cancel), :onclick => "window.location='#{systems_path}';return false", :class => :button

%hr.section
%h3 Contacts
%table.table
  %tr
    %th Name
    %th Role
    %th
  -edit_many(@system, :system_persons, :person) do |sysp|
    %td
      =sysp.role
-edit_many_attach(@system, :system_persons, :person)

